/**
 * Created by asus on 17/08/14.
 */
// 1.0 引相关依赖的包,并绑定在Vue原型上
import Vue from 'vue';

import vueRouter from 'vue-router';
Vue.use(vueRouter);
import vueResource from 'vue-resource';
Vue.use(vueResource);
import mintui from 'mint-ui';
Vue.use(mintui);

// 2.0 引入 css 相关依赖文件
import '../statics/mui/css/mui.css';
import '../node_modules/mint-ui/lib/style.min.css';
import '../statics/css/site.css';

// 3.0 导入 App.vue组件（根组件）
import App from './App.vue';

// 4导入其他页面组件
import home from './components/home.vue';
import shopcar from './components/shopcar/shopcar.vue';

// 5.0 配置路由规则
// 点击路由按钮时，动态的样式router-link-active，绑定给mui-active
// 即设置linkActiveClass = mui-active
var router = new vueRouter({
    linkActiveClass: 'mui-active',
    routes: [
        // 默认路径为home
        {
            path: '/',
            redirect: '/home'
        },
        {
            path: '/home',
            component: home
        },
        {
            path: '/shopcar',
            component: shopcar
        }
    ]
});


// 6.0 创建 Vue 实例
new Vue({
    el: '#app',
    router,
    //render: function (create){return create(App);} // es5 语法 记得写 return
    render: c=>c(App)
});